Double world champion Alonso finished third, eclipsed before his 140,000 strong home crowd by Brazilian Massa and the extraordinary Hamilton.
Raikkonen was in third place when he suddenly slowed, allowing Spaniard Alonso past. The Finn nursed his car back to the pits and climbed out.
McLaren: Raikkonen produced a brilliant race with a two-stop strategy.
Narain Karthikeyan finished 17th in Saturday's first qualifying for Sunday's Monaco Grand Prix.
Team by team analysis of Sunday's San Marino Formula One Grand Prix (listed in championship order).\n
Renault's world champion Alonso finished second ahead of Ferrari's Michael Schumacher.
The Ferrari driver ended world champion Fernando Alonso's run of five successive poles.
With Sebastian Vettel's fourth successive Formula One title now just a formality, the more intriguing question is whether the Red Bull driver can go on to match a record that has stood for 60 years.
Kimi Raikkonen took pole position on an all-Ferrari front row for the Belgian Grand Prix.
McLaren's Lewis Hamilton led the Hungarian Grand Prix from start to finish on Sunday to stretch his championship lead over unhappy team mate Fernando Alonso to seven points.
Finland's Kimi Raikkonen won the French Grand Prix on Sunday, leading Brazilian team mate Felipe Massa in a Ferrari one-two to end McLaren's winning streak.
Lance Armstrong has been voted sports personality of the year, according to a poll published in the Spanish daily
Red Bull's Max Verstappen sang "Viva Las Vegas" after racing to a record-extending 18th victory of the season and joining Sebastian Vettel in third place on Formula One's all-time winners' list.
Ferrari president Luca di Montezemolo has warned against possible technical 'trickery' as Formula One enters a new and uncertain era.
Germany's Nico Rosberg gave Mercedes their third pole position in succession on Saturday with a front row lockout at the Spanish Formula One Grand Prix.
The Scot believes his former McLaren team mate Kimi Raikkonen could yet emerge as Formula One champion this season.\n
Germany's Nico Rosberg took Mercedes' second successive pole position in qualifying for the Bahrain Formula One Grand Prix on Saturday.
Sahara Force India made a promising start to the 2017 Formula One season with a double points finish through Sergio Perez and Esteban Ocon at the Australian Grand Prix in Melbourne, on Sunday.
Fernando Alonso put Renault on pole position for Sunday's Malaysian Grand Prix.
Seven times world champion Michael Schumacher will start in 14th place after replacing his engine.
Michael Schumacher is confident he can overtake Fernando Alonso with four races to go in the F1 season.
Finn Kimi Raikkonen reported back to work as Formula One world champion on Tuesday.
The Ferrari driver's main aim is to prevent Fernando Alonso from chalking up a fifth successive win.
Charles Leclerc put Ferrari on pole position for Sunday's US Grand Prix after Red Bull's triple Formula One world champion Max Verstappen had a faster lap deleted for exceeding track limits and dropped to sixth on the grid.
Kimi Raikkonen won the Belgian Grand Prix for the third time in a row on Sunday, leading a Ferrari one-two.
A puncture slashed Lewis Hamilton's championship lead over McLaren team mate Fernando Alonso to five points.
McLaren's Lewis Hamilton showed no signs of being slowed by a weekend bout of flu when he set the pace in Friday's first free practice for the European Grand Prix.
Triple Formula One world champion Sebastian Vettel would be Ferrari's first choice should they ever need to replace Fernando Alonso, president Luca di Montezemolo said.
McLaren have promised Lewis Hamilton and Fernando Alonso a quicker car for the next race in Germany after losing to Ferrari for the second weekend in a row.
On the 20th death anniversary of Brazilian Formula One legend Ayrton Senna, fans and the sporting community paid tribute to the man who was arguably one of the best drivers in F1 history.
Former world champion Alain Prost believes that McLaren are playing with fire in granting Lewis Hamilton and Fernando Alonso equal status in the team.
Red Bull's Sebastian Vettel committed no infringement during the season-ending Brazilian Grand Prix, Formula One's governing body the FIA said on Friday, meaning the German keeps his world title.
Red Bull and Renault will be working flat out to ensure Formula One championship leader Sebastian Vettel does not go into next weekend's title showdown in Brazil with a 'ticking time bomb' deep inside his car.
McLaren's Lewis Hamilton will start Sunday's Abu Dhabi Formula One Grand Prix on pole position with Red Bull's Australian Mark Webber also on the front row.